package demo;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: syyyy
 * Date: 2025-07-14
 * Time: 15:47
 */
public class Login {
    private String name;
    private String password;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void login(String name,String password) {
        if (!this.name.equals(name)) {
            throw new PasswordException("name错误异常.....");
        }
        if (!(this.password.equals(password))) {
            throw new PasswordException("密码错误");
        }
        System.out.println("登陆成功");
        }
    }
